home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 2920 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  960 b 

  1. Path: ix.netcom.com!netnews
  2. From: miker3@ix.netcom.com (Mike Rubenstein)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Is it possible?
  5. Date: Thu, 25 Jan 1996 00:14:31 GMT
  6. Organization: Netcom
  7. Message-ID: <3106bfd8.6942016@nntp.ix.netcom.com>
  8. References: <4e5kuq$9i7@news.ust.hk>
  9. NNTP-Posting-Host: ix-dc14-03.ix.netcom.com
  10. X-NETCOM-Date: Wed Jan 24  4:14:34 PM PST 1996
  11. X-Newsreader: Forte Agent .99c/16.141
  12.  
  13. ee_chung@uxmail.ust.hk (Chu Shiu Chung) wrote:
  14.  
  15. > Hello,
  16. >      If I have declare the following:
  17. >           #define FILENUM  12
  18. >      Is it possible to make the compiler to replace this in printf:
  19. >            printf("FILENUM is the number of files");
  20. > instead of
  21. >            printf("%d is the number of files", FILENUM);
  22. > Just like what the compiler do in: int a=FILENUM;
  23.  
  24.     #define num_to_string_really(x) #x
  25.     #define num_to_string(x) num_to_string_really(x)
  26.  
  27.     printf(num_to_string(FILENUM) " is the number of files");
  28.  
  29.  
  30. Michael M Rubenstein
  31.